package BasicEngine
{
	import flash.display.DisplayObject;
	import flash.utils.Dictionary;
	/**
	 * 键盘鼠标管理器
	 * @author lzn 2012.4.24
	 */
	public class KeyMouseManager 
	{
		public static var  Keys:Vector.<Boolean>;	
		public static var KeyAccepts:Vector.<int>;    //键盘观察者注册表
		public static var MouseAccepts:Vector.<int>;//鼠标观察者注册表
		
		public static var KeyDowns:Dictionary;
		
		public static var IsMouseDown:Boolean;
		public static var IsMouseRightDown:Boolean;
		public static var IsKeyDown:Boolean;		
		
		public function KeyMouseManager() 
		{			
		}
		
		public static function AddEvent(_eventName:String,_el:DisplayObject, _handle:Function):void
		{
			_el.addEventListener(_eventName, _handle);
		}
		
		public static function Remove(_eventName:String, _el:DisplayObject, _handle:Function):void
		{
			_el.removeEventListener(_eventName, _handle);
		}
		
		public static function Init():void
		{
			Keys = new Vector.<Boolean>();
			KeyAccepts = new Vector.<int>();
			MouseAccepts = new Vector.<int>();
			KeyDowns = new Dictionary();
		}
	}
	
}